#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
	int t;
	cin >> t;
	while (t--) {
		int n, x, sum = 0;
		cin >> n;
		for (int i = 1; i <= n; i++) {
			cin >> x;
			sum += x;
		}
		if ((int)sqrtl(sum) * sqrtl(sum) == sum)
			cout << "YES" << endl;
		else
			cout << "NO" << endl;
	}
	return 0;
}
